const {shell} = require('electron')

let a = document.querySelector('#a')
console.log('1222', a)
a.onclick = function (e) {
  e.preventDefault()

  const href = this.getAttribute('href')
  // console.log('href', href)
  shell.openExternal(href)
}

let btn = document.querySelector('#open')
btn.onclick = function(e) {
  // window.open('https://baidu.com')
  window.open('./popup.html')
}

// 监听
window.addEventListener('message', (msg) => {
  console.log(msg)
  const text = document.querySelector('#text')
  text.innerHTML = JSON.stringify(msg.data)
})